<?php


namespace app\index\model;

use think\Model;
class User extends Model
{
    protected $pk = 'id';
    protected $autoWriteTimestamp = true; //自动时间戳
    protected $createTime  = 'create_time';
    protected $updateTime = 'update_time';
    protected $dateFormat = 'Y年m月d日 H时i分s秒';


    //获取器
    public function getStatusAttr($value){
        $status = ['1'=>'启用','0'=>'禁用'];
        return $status[$value];
    }


public function getIsAdminAttr($value){
        $is_admin = ['1'=>'管理员','0'=>'注册会员'];
        return $is_admin[$value];
    }

    //修改器

    public function setPasswordAttr($value){
        return sha1($value);
    }



}